<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorator="layout/default">
<head>
    <meta charset="UTF-8"/>
    <title th:text="#{loginPage.title}">Login</title>
</head>
<body>
<div class="row" layout:fragment="content">
    <div class="container">
        <h2 class="header center indigo-text" th:text="#{loginPage.title}">Login</h2>
        <div class="row">
            <div class="card-panel red lighten-2" th:if="${param.error}">
                <span th:text="#{loginPage.error}">Invalid username or password</span>
            </div>
            <form class="col s12" action="/login" method="post">
                <div class="row">
                    <div class="input-field col s12">
                        <input id="username" name="username" type="text" class="validate"/>
                        <label for="username" th:text="#{loginPage.userName}">Username</label>
                    </div>
                </div>
                <div class="row">
                    <div class="input-field col s12">
                        <input id="password" name="password" type="password" class="validate"/>
                        <label for="password" th:text="#{loginPage.password}">Password</label>
                    </div>
                </div>
                <div class="row center">
                    <button class="btn waves-effect waves-light" type="submit" name="action" th:text="#{loginPage.loginButton}">Submit</button>
                </div>
                <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
            </form>
            <div class="row center">
                <a class="btn waves-effect waves-light" th:href="|https://github.com/login/oauth/authorize?scope=read:user&amp;client_id=${oauthGithubClientId}|" th:text="#{loginPage.loginGithubButton}">Login with Github</a>
            </div>
        </div>
    </div>
</div>
</body>
</html>